<?php
abstract class Ajax {
    public $template;
    public function prepare() {
        global $gSmarty;
        $uid = $_REQUEST['uid'];
        if ($uid!="" && $uid != $_SESSION['G_USERID']) {
            $userid = $uid;
            $gSmarty->assign("if_self", 0);
        } else {
            $userid = $_SESSION['G_USERID'];
            $gSmarty->assign("if_self", 1);
        }

    }
    public function getTemplate() {
        return $this->template;
    }
    public function fetch() {
        global $gSmarty;
        echo $gSmarty->fetch($this->getTemplate());
    }
}
?>